package com.ksc.storekeeper.client.ui.tab;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
import com.gwtplatform.mvp.client.TabData;

public class MainTabPanel extends BaseTabPanel {

	private static MainTabPanelUiBinder uiBinder = GWT.create(MainTabPanelUiBinder.class);

	interface MainTabPanelUiBinder extends UiBinder<Widget, MainTabPanel> {
	}

	@UiField
	HTMLPanel logoutBtn;
	
	public MainTabPanel() {
		initWidget(uiBinder.createAndBindUi(this));
		
		ClickHandler clickHandler = new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				Window.Location.replace("logout");
			}
		};
		logoutBtn.addDomHandler(clickHandler, ClickEvent.getType());
	}

	@Override
	protected BaseTab createNewTab(TabData tabData) {
		return new MainTab(tabData);
	}
}
